INT0 and PCINT0 simultaneously with attiny13

您所在的位置:网站首页 arduino pcint INT0 and PCINT0 simultaneously with attiny13

INT0 and PCINT0 simultaneously with attiny13

2024-06-13 05:26| 来源: 网络整理| 查看: 265

PaulS: I don't know what your problem is, but I do have to wonder why buttonFlag needs to be a multi-byte type, when it will only ever hold 0 or 1.

youre right, I switched it for a volatile Boolean.

My problem is that I wanted 2 buttons to trigger different effects, so I was planning on using the 2 attiny13 external interrupt vectors: PCINT0 and INT0. This way, when pressing button 1, the 1st vector should trigger, or when pressing button 2, the other vector should trigger instead. This would help me have a more complete user interface with a sleeping uC. However, the code I shared only works with PCINT0: that means only 1 of my two interrupt button pins actually trigger an interrupt. The other one, hooked up to INT0 (pin 1), isn't able to wake up the attiny when pushed.

So, I wanted to understand if something is wrong with my code! Thanks again



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3